#include "File.hpp"

File::File()
{
  memset(&m_info, 0, sizeof(m_info));
}

File::File(string path)
{
  File();
  SetPath(path);
}

void File::SetPath(string path)
{
  m_path = path;
}

string GetPath()
{
  return m_path;
}


bool File::IsApplication()
{
  return (::SHGetFileInfo(m_path.c_str(), 0, &m_info, sizeof(m_info), SHGFI_EXETYPE) != 0);
}

::HICON File::GetIcon()
{
  if (::SHGetFileInfo(m_path.c_str(), 0, m_info, sizeof(m_info), SHGFI_ICON) != 0)
    return m_info.hIcon;
  return NULL;
}